*DO FILE TO REPLICATE RESULTS FROM IO ARTICLE "INTERNATIONAL LAW AND PUBLIC ATTITUDES TOWARD TORTURE: AN EXPERIMENTAL STUDY."


version 12

*Set command directory to location where replication files saved


*ANALYSIS FOR INTERNATIONAL LAW EXPERIMENT

use "torture_law.dta", clear


*TABLE 1: Effect of International Law on Support for Torture
proportion torture2
proportion torture2, over(treaty)
prtest torture2, by(treaty)


*TABLE 2: Effect of International Law on Support for Torture, by Conflict Context
*By Soldier
proportion torture2 if insurgent==0, over(treaty)
prtest torture2 if insurgent==0, by(treaty)
*By Insurgent
proportion torture2 if insurgent==1, over(treaty)
prtest torture2 if insurgent==1, by(treaty)
*By No Reciprocity
proportion torture2 if reciprocity==0, over(treaty)
prtest torture2 if reciprocity==0, by(treaty)
*By Reciprocity
proportion torture2 if reciprocity==1, over(treaty)
prtest torture2 if reciprocity==1, by(treaty)


*TABLE 3: Effect of International Law on Support for Torture, by Political Ideology
*Liberals
proportion torture2 if ideology2==1, over(treaty)
prtest torture2 if ideology2==1, by(treaty)
*Conservatives
proportion torture2 if ideology2==0, over(treaty)
prtest torture2 if ideology2==0, by(treaty)


*TABLE 4: International Law and Individual Support for Torture, Ordered Logit Analysis
*Model 1
ologit torture7 treaty insurgent reciprocity ideology0 ppagecat ppeducat male security military white black hispanic, nolog
*Model 2 with international law-political ideology interaction
ologit torture7 treaty insurgent reciprocity ideology0 ideology0_treaty ppagecat ppeducat male security military white black hispanic, nolog

*Estimating models from Table 4 using OLS as a robustness check
*Model 1
reg torture7 treaty insurgent reciprocity ideology0 ppagecat ppeducat male security military white black hispanic
*Model 2
reg torture7 treaty insurgent reciprocity ideology0 ideology0_treaty ppagecat ppeducat male security military white black hispanic
*Generating figure to show interaction effects between political ideology and international law (equivalent to Figure 1)
*	Note: requires installing -grinter- utility
grinter treaty, inter(ideology0_treaty) con(ideology0) depvar(torture7) nomean


*FIGURE 1: Assessing conditional effect of political ideology on international law
*Generate data used in Figure 1
*	Note: requires CLARIFY package
*	Results from analysis generated below are saved in "torture_figure1.dta".
*Run Model 2
*	Note: Use version of dependent variable that collapses together all three levels of agree and disagree toward torture respectively
estsimp ologit torture3 treaty insurgent reciprocity ideology0 ideology0_treaty ppagecat ppeducat male security military white black hispanic, nolog
*Set reciprocity to 0; insurgent to 1; treaty to 0; interaction term to 0; and other covariates at their medians.
setx (treaty reciprocity ideology0_treaty) 0 (insurgent) 1 (ideology0 ppagecat ppeducat male security military) median (white) 1 (black hispanic) 0
*Estimate the effect of international law on the probability of supporting torture at each level of political ideology
setx ideology0 0
simqi, fd(pr) changex(treaty 0 1)
setx ideology0 1
simqi, fd(pr) changex(treaty 0 1 ideology0_treaty 0 1)
setx ideology0 2
simqi, fd(pr) changex(treaty 0 1 ideology0_treaty 0 2)
setx ideology0 3
simqi, fd(pr) changex(treaty 0 1 ideology0_treaty 0 3)
setx ideology0 4
simqi, fd(pr) changex(treaty 0 1 ideology0_treaty 0 4)
setx ideology0 5
simqi, fd(pr) changex(treaty 0 1 ideology0_treaty 0 5)
setx ideology0 6
simqi, fd(pr) changex(treaty 0 1 ideology0_treaty 0 6)

*Generate Figure 1: Effect of International Law on Support for Torture, by Level of Political Ideology
use "torture_figure1.dta", clear

twoway (scatter effect ideology2, msymbol(i) connect(l) lpattern(solid) lcolor(black)) ///
	(scatter lower95ci ideology2, msymbol(i) connect(1) lpattern(dash) lcolor(black)) ///
	(scatter upper95ci ideology2, msymbol(i) connect(1) lpattern(dash) lcolor(black)), ///
	yline(0, lcolor(gs12)) ///
	/* title("Figure 1: Effect of International Law on Support for Torture, by Level of Political Ideology") */ ///
	ytitle("Effect of International Law on Change in" "Predicted Probability: Agree to Use Torture") ///
	xtitle("Political Ideology") ///
	xlabel(1 "Ex Cons" 2 "Cons" 3 "Slight Cons" 4 "Mod" 5 "Slight Lib" 6 "Lib" 7 "Ex Lib") ///
	legend(label(1 "") label(2 "95% confidence intervals") order(2)) ///
	scheme(s1mono) ///
	note("Note: Results are generated using Model 2 from Table 4. Y-axis measures the first difference" "between the international law treatment and control groups on the probability of reporting" "any level of support for torture. First difference assumes a scenario involving insurgents" "and no reciprocity; all other independent variables are set to their median values.")



*ANALYSIS FOR INTERNATIONAL LEGALIZATION EXPERIMENT

use "torture_legalization.dta", clear


*TABLE 5: Effect of International Legalization on Support for Torture
proportion torture2
*Obligation
proportion torture2, over(obligation)
prtest torture2, by(obligation)
*Precision
proportion torture2, over(precision)
prtest torture2, by(precision)
*Delegation
proportion torture2, over(delegation)
prtest torture2, by(delegation)


*TABLE 6: Effect of International Legalization on Support for Torture, by Political Ideology
*Obligation
*For Liberals
proportion torture2 if ideology2==1, over(obligation)
prtest torture2 if ideology2==1, by(obligation)
*For Conservatives
proportion torture2 if ideology2==0, over(obligation)
prtest torture2 if ideology2==0, by(obligation)

*Precision
*For Liberals
proportion torture2 if ideology2==1, over(precision)
prtest torture2 if ideology2==1, by(precision)
*For Conservatives
proportion torture2 if ideology2==0, over(precision)
prtest torture2 if ideology2==0, by(precision)

*Delegation
*For Liberals
proportion torture2 if ideology2==1, over(delegation)
prtest torture2 if ideology2==1, by(delegation)
*For Conservatives
proportion torture2 if ideology2==0, over(delegation)
prtest torture2 if ideology2==0, by(delegation)


*TABLE 7: International Legalization and Individual Support for Torture, Ordered Logit Analysis
*Model 1
ologit torture7 obligation precision delegation ideology0 ppagecat ppeducat male security military white black hispanic, nolog
*Model 2: Obligation*Political Ideology interaction
ologit torture7 obligation precision delegation ideology0 ideology0_obligation ppagecat ppeducat male security military white black hispanic, nolog
*Model 3: Precision*Political Ideology interaction
ologit torture7 obligation precision delegation ideology0 ideology0_precision ppagecat ppeducat male security military white black hispanic, nolog
*Model 4: Delegation*Political Ideology interaction
ologit torture7 obligation precision delegation ideology0 ideology0_delegation ppagecat ppeducat male security military white black hispanic, nolog

*Estimating models from Table 7 using OLS as a robustness check
*	Note -grinter- commands subsequent to Models 2 through 4 intended to show conditional effect of political ideology 
*	on relevant legalization component.
*Model 1
reg torture7 obligation precision delegation ideology0 ppagecat ppeducat male security military white black hispanic
*Model 2: Obligation*Political Ideology interaction
reg torture7 obligation precision delegation ideology0 ideology0_obligation ppagecat ppeducat male security military white black hispanic
grinter obligation, inter(ideology0_obligation) con(ideology0) depvar(torture7) nomean
*Model 3: Precision*Political Ideology interaction
reg torture7 obligation precision delegation ideology0 ideology0_precision ppagecat ppeducat male security military white black hispanic
grinter precision, inter(ideology0_precision) con(ideology0) depvar(torture7) nomean
*Model 4: Delegation*Political Ideology interaction
reg torture7 obligation precision delegation ideology0 ideology0_delegation ppagecat ppeducat male security military white black hispanic
grinter delegation, inter(ideology0_delegation) con(ideology0) depvar(torture7) nomean


*FIGURE 2: Assessing conditional effect of political ideology on precision
*Generate data used in Figure 2
*	Note: requires CLARIFY package
*	Results from analysis generated below are saved in "torture_figure2.dta".
*Run Model 3
*	Note: Use version of dependent variable that collapses together all three levels of agree and disagree toward torture respectively
estsimp ologit torture3 obligation precision delegation ideology0 ideology0_precision ///
	ppagecat ppeducat male security military white black hispanic, nolog
*Set obligation to 1; delegation to 0; precision to 0; interaction term to 0; and other variables at their medians
setx obligation 1 (delegation precision ideology0_precision) 0 ///
	(ideology0 ppagecat ppeducat male security military) median (white) 1 (black hispanic) 0 
*Estimate the effect of precision on the probability of supporting torture at each level of political ideology
setx ideology0 0
simqi, fd(pr) changex(precision 0 1)
setx ideology0 1
simqi, fd(pr) changex(precision 0 1 ideology0_precision 0 1)
setx ideology0 2
simqi, fd(pr) changex(precision 0 1 ideology0_precision 0 2)
setx ideology0 3
simqi, fd(pr) changex(precision 0 1 ideology0_precision 0 3)
setx ideology0 4
simqi, fd(pr) changex(precision 0 1 ideology0_precision 0 4)
setx ideology0 5
simqi, fd(pr) changex(precision 0 1 ideology0_precision 0 5)
setx ideology0 6
simqi, fd(pr) changex(precision 0 1 ideology0_precision 0 6)

*Generate Figure 2: Effect of Precision on Support for Torture, by Level of Political Ideology
use "torture_figure2.dta", clear

twoway (scatter effect ideology2, msymbol(i) connect(l) lpattern(solid) lcolor(black))  ///
	(scatter lower95ci ideology2, msymbol(i) connect(1) lpattern(dash) lcolor(black)) ///
	(scatter upper95ci ideology2, msymbol(i) connect(1) lpattern(dash) lcolor(black)), ///
	yline(0, lcolor(gs12)) ///
	/* title("Figure 2: Effect of Precision on Support for Torture, by Level of Political Ideology") */ ///
	ytitle("Effect of Precision on Change in" "Predicted Probability: Agree to Use Torture") ///
	xtitle("Political Ideology") ///
	xlabel(1 "Ex Cons" 2 "Cons" 3 "Slight Cons" 4 "Mod" 5 "Slight Lib" 6 "Lib" 7 "Ex Lib") ///
	legend(label(1 "") label(2 "95% confidence intervals") order(2)) ///
	scheme(s1mono) ///
	note("Note: Results are generated using Model 3 from Table 7. Y-axis measures the first difference" "between the high precision treatment and the low precision control groups on the" "probability of reporting any level of support for torture. First difference assumes a scenario" "involving high obligation and low delegation; all other independent variables are set to" "their median values.")


*FIGURE 3: Assessing conditional effect of political ideology on delegation
*Generate data used in Figure 3
*	Note: requires CLARIFY package
*	Results from analysis generated below are saved in "torture_figure3.dta".
*Return to legalization experiment data set
use "torture_legalization.dta", clear
*Run Model 4
*	Note: Use version of dependent variable that collapses together all three levels of agree and disagree toward torture respectively
estsimp ologit torture3 obligation precision delegation ideology0 ideology0_delegation ///
	ppagecat ppeducat male security military white black hispanic, nolog
*Set obligation to 1; delegation to 0; precision to 0; interaction term to 0; and other variables at their medians
setx obligation 1 (delegation precision ideology0_delegation) 0 ///
	(ideology0 ppagecat ppeducat male security military) median (white) 1 (black hispanic) 0 
*Estimate the effect of delegation on the probability of supporting torture at each level of political ideology
setx ideology0 0
simqi, fd(pr) changex(delegation 0 1)
setx ideology0 1
simqi, fd(pr) changex(delegation 0 1 ideology0_delegation 0 1)
setx ideology0 2
simqi, fd(pr) changex(delegation 0 1 ideology0_delegation 0 2)
setx ideology0 3
simqi, fd(pr) changex(delegation 0 1 ideology0_delegation 0 3)
setx ideology0 4
simqi, fd(pr) changex(delegation 0 1 ideology0_delegation 0 4)
setx ideology0 5
simqi, fd(pr) changex(delegation 0 1 ideology0_delegation 0 5)
setx ideology0 6
simqi, fd(pr) changex(delegation 0 1 ideology0_delegation 0 6)

*Generate Figure 3: Effect of Delegation on Support for Torture, by Level of Political Ideology
use "torture_figure3.dta", clear

twoway (scatter effect ideology2, msymbol(i) connect(l) lpattern(solid) lcolor(black))  ///
	(scatter lower95ci ideology2, msymbol(i) connect(1) lpattern(dash) lcolor(black)) ///
	(scatter upper95ci ideology2, msymbol(i) connect(1) lpattern(dash) lcolor(black)), ///
	yline(0, lcolor(gs12)) ///
	/* title("Figure 3: Effect of Delegation on Support for Torture, by Level of Political Ideology") */ ///
	ytitle("Effect of Delegation on Change in" "Predicted Probability: Agree to Use Torture") ///
	xtitle("Political Ideology") ///
	xlabel(1 "Ex Cons" 2 "Cons" 3 "Slight Cons" 4 "Mod" 5 "Slight Lib" 6 "Lib" 7 "Ex Lib") ///
	legend(label(1 "") label(2 "95% confidence intervals") order(2)) ///
	scheme(s1mono) ///
	note("Note: Results are generated using Model 4 from Table 7. Y-axis measures the first difference" "between the high delegation treatment and the low delegation control groups on the" "probability of reporting any level of support for torture. First difference assumes a scenario" "involving high obligation and low precision; all other independent variables are set to their" "median values.")
